﻿using System;

namespace TK
{
    public partial class CustomSerializer
    {
        object readNullable(CustomSerializerState state, Type expectedType)
        {
            var arg0 = expectedType.GetGenericArguments()[0];

            TypeHandler handler;
            if (SimpleTypes.TryGetValue(arg0, out handler)) return handler.Read(state);
            throw new NotSupportedException("Can't read '" + expectedType.AssemblyQualifiedName + "'");
        }
    }
}